Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Web
Imports DevExpress.ExpressApp.Xpo

Partial Public Class Solution1AspNetApplication
    Inherits WebApplication
    Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule
    Private module2 As DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule
    Private module3 As Solution1.Module.Solution1Module
    Private module4 As Solution1.Module.Web.Solution1AspNetModule
    Friend WithEvents SchedulerAspNetModule1 As DevExpress.ExpressApp.Scheduler.Web.SchedulerAspNetModule
    Friend WithEvents SchedulerModuleBase1 As DevExpress.ExpressApp.Scheduler.SchedulerModuleBase
    Friend WithEvents ValidationModule1 As DevExpress.ExpressApp.Validation.ValidationModule
    Friend WithEvents SecurityModule1 As DevExpress.ExpressApp.Security.SecurityModule
    Friend WithEvents SecurityComplex1 As DevExpress.ExpressApp.Security.SecurityComplex
    Friend WithEvents AuthenticationStandard1 As DevExpress.ExpressApp.Security.AuthenticationStandard
    Friend WithEvents ReportsModule1 As DevExpress.ExpressApp.Reports.ReportsModule
    Friend WithEvents ReportsAspNetModule1 As DevExpress.ExpressApp.Reports.Web.ReportsAspNetModule
    Friend WithEvents KpiModule1 As DevExpress.ExpressApp.Kpi.KpiModule

    Private sqlConnection1 As System.Data.SqlClient.SqlConnection

    Public Sub New()
        InitializeComponent()
    End Sub

    Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
        args.ObjectSpaceProvider = New XPObjectSpaceProviderThreadSafe(args.ConnectionString, args.Connection)
    End Sub

    Private Sub Solution1AspNetApplication_DatabaseVersionMismatch(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs) Handles MyBase.DatabaseVersionMismatch
#If EASYTEST Then
        e.Updater.Update()
        e.Handled = True
#Else
        If System.Diagnostics.Debugger.IsAttached Then
            e.Updater.Update()
            e.Handled = True
        Else
            Dim message As String = "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application." & Constants.vbCrLf & _
                "This error occurred  because the automatic database update was disabled when the application was started without debugging." & Constants.vbCrLf & _
                "To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " & _
                "source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " & _
                "or manually create a database using the 'DBUpdater' tool." & Constants.vbCrLf & _
                "Anyway, refer to the following help topics for more detailed information:" & Constants.vbCrLf & _
                "'Update Application and Database Versions' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm" & Constants.vbCrLf & _
                "'Database Security References' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument3237.htm" & Constants.vbCrLf & _
                "If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/"

            If e.CompatibilityError IsNot Nothing AndAlso e.CompatibilityError.Exception IsNot Nothing Then
                message &= Constants.vbCrLf & Constants.vbCrLf & "Inner exception: " & e.CompatibilityError.Exception.Message
            End If
            Throw New InvalidOperationException(message)
        End If
#End If
    End Sub

    Private Sub InitializeComponent()
        Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule()
        Me.module2 = New DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule()
        Me.sqlConnection1 = New System.Data.SqlClient.SqlConnection()
        Me.SchedulerAspNetModule1 = New DevExpress.ExpressApp.Scheduler.Web.SchedulerAspNetModule()
        Me.SchedulerModuleBase1 = New DevExpress.ExpressApp.Scheduler.SchedulerModuleBase()
        Me.ValidationModule1 = New DevExpress.ExpressApp.Validation.ValidationModule()
        Me.SecurityModule1 = New DevExpress.ExpressApp.Security.SecurityModule()
        Me.module3 = New Solution1.[Module].Solution1Module()
        Me.module4 = New Solution1.[Module].Web.Solution1AspNetModule()
        Me.SecurityComplex1 = New DevExpress.ExpressApp.Security.SecurityComplex()
        Me.AuthenticationStandard1 = New DevExpress.ExpressApp.Security.AuthenticationStandard()
        Me.ReportsModule1 = New DevExpress.ExpressApp.Reports.ReportsModule()
        Me.ReportsAspNetModule1 = New DevExpress.ExpressApp.Reports.Web.ReportsAspNetModule()
        Me.KpiModule1 = New DevExpress.ExpressApp.Kpi.KpiModule()
        CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
        '
        'sqlConnection1
        '
        Me.sqlConnection1.ConnectionString = "Integrated Security=SSPI;Pooling=false;Data Source=.\SQLEXPRESS;Initial Catalog=S" & _
            "olution1"
        Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
        '
        'ValidationModule1
        '
        Me.ValidationModule1.AllowValidationDetailsAccess = True
        '
        'SecurityComplex1
        '
        Me.SecurityComplex1.Authentication = Me.AuthenticationStandard1
        Me.SecurityComplex1.RoleType = GetType(DevExpress.Persistent.BaseImpl.Role)
        Me.SecurityComplex1.UserType = GetType(DevExpress.Persistent.BaseImpl.User)
        '
        'AuthenticationStandard1
        '
        Me.AuthenticationStandard1.LogonParametersType = GetType(DevExpress.ExpressApp.Security.AuthenticationStandardLogonParameters)
        '
        'ReportsModule1
        '
        Me.ReportsModule1.EnableInplaceReports = True
        Me.ReportsModule1.ReportDataType = GetType(DevExpress.Persistent.BaseImpl.ReportData)
        '
        'Solution1AspNetApplication
        '
        Me.ApplicationName = "Solution1"
        Me.Connection = Me.sqlConnection1
        Me.Modules.Add(Me.module1)
        Me.Modules.Add(Me.module2)
        Me.Modules.Add(Me.ValidationModule1)
        Me.Modules.Add(Me.ReportsModule1)
        Me.Modules.Add(Me.ReportsAspNetModule1)
        Me.Modules.Add(Me.KpiModule1)
        Me.Modules.Add(Me.module3)
        Me.Modules.Add(Me.module4)
        Me.Modules.Add(Me.SchedulerModuleBase1)
        Me.Modules.Add(Me.SchedulerAspNetModule1)
        Me.Modules.Add(Me.SecurityModule1)
        Me.Security = Me.SecurityComplex1
        CType(Me, System.ComponentModel.ISupportInitialize).EndInit()

    End Sub
End Class

